// MSDN.h
// MSDNApp.h : main header file for the MSDN application
//
#pragma once
#ifndef __AFXWIN_H__
#error "include 'stdafx.h' before including this file for PCH"
#endif
#include "Resource.h"       // main symbols
#include "MSDN_i.h"

// CMSDNApp:
// See  for the implementation of this class
//
class CMSDNApp : public CWinApp,
	public saf::CComFramework,
	public IDispEventImpl<2, CMSDNApp, &saf::DIID__IComFrameworkEvents, &saf::LIBID_ArtFrameLib, -1, -1>
{
public:
	CMSDNApp();
	saf::IMainFrame* GetMainFrame() { return m_pMainFrame; }

public: // com Event
	BEGIN_SINK_MAP(CMSDNApp)
		SINK_ENTRY_EX(/*nID =*/ 2, saf::DIID__IComFrameworkEvents, /*dispid =*/ ID_ComFramework_CloseMainFrame, &OnCloseMainFrame)
		SINK_ENTRY_EX(/*nID =*/ 2, saf::DIID__IComFrameworkEvents, /*dispid =*/ ID_ComFramework_Quit, &OnQuit)
	END_SINK_MAP()

	void __stdcall OnQuit(VARIANT_BOOL* bExit);
	void __stdcall OnCloseMainFrame(BSTR strKind, saf::IMainFrame* pMainFrame, VARIANT_BOOL *bExit);

	// Overrides
public:
	virtual BOOL InitInstance();
protected:

	void CreateTools();
	HRESULT CreateMDISplitterWnd(int nShowCmd);
public:
	DECLARE_MESSAGE_MAP()
private:
	CComPtr<saf::IMainFrame>	m_pMainFrame;
	typedef saf::CComFramework safBaseClass;
public:
	BOOL ExitInstance(void);
};

extern CMSDNApp theApp;

